package org.xhy.hrm.feign;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
import org.xhy.hrm.doc.CourseDoc;
import org.xhy.hrm.util.AjaxResult;

@Component
public class CourseESFeignFallbackFactory implements FallbackFactory<CourseESFeign> {
    @Override
    public CourseESFeign create(Throwable throwable) {
        return new CourseESFeign() {
            @Override
            public AjaxResult save(CourseDoc courseDoc) {
                throwable.printStackTrace();
                return AjaxResult.me().setSuccess(false).setMessage("上线失败");
            }

            @Override
            public AjaxResult deleteById(Long id) {
                throwable.printStackTrace();
                return AjaxResult.me().setSuccess(false).setMessage("下线失败");
            }
        };
    }
}
